#pragma once

#include <vector>

class CDC;
class CSquare;
class CLocalPane;

typedef std::vector<CSquare> SquareVec;
typedef SquareVec::iterator SquareVecIter;
typedef SquareVec::const_iterator SquareVecCIter;

class CSquareLine
{
public:
	CSquareLine(CLocalPane* pSquarePane, CPoint point, UINT count, UINT nSideWidth);
	~CSquareLine(void);

	void Draw(CDC* pDC);
    void Fill(CDC* pDC);

	bool SquareInLine(const CSquare& square);
	void SwapLineState(CSquareLine& squareLine);    // flag and color

	bool IsEmpty() const;
	bool IsFull() const;
	void SetEmpty();

    // Attributes
    UINT GetSquareCount() const;
    UINT GetSquareWidth() const;

    // Operators
    CSquare& operator[](UINT nIndex); // Index from 0 to n-1

private:
	CLocalPane *m_pSquarePane;
	SquareVec	m_vecSquare;

	CPoint	m_pntLeftTop;
	CPoint	m_pntRightBottom;

	UINT	m_nSquareCount;
    UINT    m_nSquareWidth;
};